home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / share / Dos / VARIOS / pascal / DELPHI.SWG / 0007_Execute DELPHI.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-02-21  |  1.3 KB  |  46 lines

  1.  
  2. program ExDelphi;
  3.  {executes Delphi, minimizing all apps currently running}
  4. uses
  5.  WinProcs, WinTypes, Messages;
  6. var
  7.  ExResult: integer;
  8.  ExResultSt: string;
  9.  
  10.  function EnumProc (WinHandle: HWnd; Param: LongInt): Boolean;
  11.   far;
  12.  begin
  13.   if (GetParent (WinHandle) = 0) and (not IsIconic (WinHandle))
  14.     and
  15.      (IsWindowVisible (WinHandle)) then
  16.   begin
  17.    SendMessage (WinHandle, WM_SYSCOMMAND, SC_MINIMIZE, 0);
  18.   end; { if...}
  19.   EnumProc := TRUE;
  20.  end; { EnumProc }
  21.  
  22.  begin {ExDelphi}
  23.    EnumWindows(@EnumProc, 0);
  24.    ExResult := WinExec ('DELPHI.EXE', SW_SHOW);
  25.    if ExResult < 32 then
  26.    begin
  27.      Str(ExResult, ExResultSt);
  28.      ExResultSt := 'Error Loading Delphi : ' + ExResultSt + #0;
  29.      MessageBox (0, @ExResultSt[1], 'EDS ExDelphi Loader',
  30.                  mb_OK or mb_IconInformation);
  31.    end; {if...}
  32.  end. {ExDelphi}
  33.  
  34. ------------------------------------------------------------------
  35. not too big of a program but supposed to be cool.  will minimize all
  36. windows as it executes delphi.
  37.  
  38. Well, it compiles and works for me. What you have to do is:
  39.         - open a new project;
  40.         - close form1 and unit1;
  41.         - open the project source;
  42.         - paste the whole code above over what is already there;
  43.         - save the project as exdelphi.DPR;
  44.         - build. {result is an EXE of 4K}
  45.  
  46.